# -*- coding: utf-8 -*-
"""
@ Created on 2024-06-14 12:23
---------
@summary: 开发环境配置
---------
@author: Lsaiah
"""

# 数据库配置
MYSQL_IP = "localhost"
MYSQL_PORT = 3306
MYSQL_DB = "py_db"
MYSQL_USER_NAME = "root"
MYSQL_USER_PASS = "lsaiah128"

# FastAPI服务配置
DEBUG = True
reload = True  # 是否热加载
workers = 1
port = 8000  # 对外暴露的端口号
host = "127.0.0.1"  # 监听地址

# Redis配置
REDIS_HOST = "localhost"
REDIS_PORT = 6379
POOL_MAX_CONNECTIONS = 1000  # 连接池最大连接数
REDIS_PASS = "python"

# JWT配置
SECRET_KEY = "your-secret-key-here-change-in-production"  # JWT密钥
ALGORITHM = "HS256"  # JWT算法
ACCESS_TOKEN_EXPIRE_MINUTES = 600  # 访问令牌过期时间（分钟）
REFRESH_TOKEN_EXPIRE_DAYS = 7  # 刷新令牌过期时间（天）

# 密码加密配置
SALT = "I9Yt7fJc12d3Sw2L"  # 加密盐值

# CORS配置
CORS_ORIGINS = [
    "http://localhost:3000",
    "http://localhost:8080",
    "http://127.0.0.1:3000",
    "http://127.0.0.1:8080",
]

# 日志配置
LOG_LEVEL = "INFO"
LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"

# 文件上传配置
MAX_FILE_SIZE = 10 * 1024 * 1024  # 10MB
UPLOAD_DIR = "uploads"

# 分页配置
DEFAULT_PAGE_SIZE = 10
MAX_PAGE_SIZE = 100